package example.lec01;

public class WoodCutter implements Person{
    
    private Axe axe;
    
    public WoodCutter()
    {
        
    }
    //构造注入方法
    public WoodCutter(Axe axe)
    {
        this.axe = axe;
    }
    //设置注入所需的set方法
    public void setAxe(Axe axe)
    {
        this.axe = axe;
    }
    
    public void useAxe() {
        System.out.println("i'm going to use axe cut woods.");
        System.out.println(axe.chop());
    }

}
